<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head th:include="main :: htmlhead"></head>
<body>
<div class="content-page" style="margin-top: -10px">
    <div class="content" >
        <div class="row">
            <div class="col-md-12">
                <div class="portlet">
                    <div class="portlet-heading portlet-default">
                        <h3 class="portlet-title">
                            <i class="ti-crown"></i>&nbsp;
                            客户管理 - 客户信息
                        </h3>
                        <div class="portlet-widgets">
                            <a data-toggle="collapse" data-parent="#accordion1" href="#bg-default"><i class="ion-minus-round"></i></a>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <div id="bg-default" class="panel-collapse collapse in">
                        <div class="portlet-body">
                            <div class="card-box">
                                <div class="row">
                                    <form class="form-inline">
                                        <div class="form-group m-t-5 m-r-5">
                                            <input id="timepicker" type="text" class="form-control" placeholder="客户名称" />

                                        </div>
                                        <button type="button" id="proxy" class=" m-t-5 m-l-15 btn btn-success btn-sm">
                                            <i class="fa fa-search m-r-5"></i> 快速查询
                                        </button>
                                        <!--
                                        <button type="button" id="proxy2" class=" m-t-5 m-l-15 btn btn-purple btn-sm">
                                            <i class="fa fa-cny (alias) m-r-5"></i> <span>客户授信</span>
                                        </button> -->

                                        <button type="button" id="proxyAdd" class=" m-t-5 m-r-15 btn btn-danger btn-sm" style="float:right;">
                                            <i class="fa fa-plus m-r-5"></i> 创建客户
                                        </button>

                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <!-- table -->
        <div class="row">
            <div class="col-sm-12" style="margin-top: -15px">
                <div class="card-box">
                    <table id="datatable-buttons-agent" style="width: 100%"
                           class="table table-striped table-bordered"
                           cellspacing="0">
                        <thead>
                        <tr>
                            <th>序号</th>
                            <th>客户名称</th>
                            <th>联系人</th>
                            <th>账户余额</th>
                            <th>通道组</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>

                        <!-- handlebars -->
                        <script id="table-template" type="text/x-handlebars-template">

                            <button class="btn btn-sm btn-purple waves-effect waves-light m-r-5"
                                    onclick="updateAgent('{{id}}','{{agentNo}}','{{agentKey}}','{{agentName}}','{{phone}}'
                                    ,'{{status}}','{{email}}','{{pro}}','{{city}}')">
                                <i class="fa  fa fa-hourglass-2 m-r-5"></i>
                                投放产品
                            </button>

                            <button class="btn btn-icon btn-success waves-effect waves-light m-r-5"
                                    onclick="updateAgent('{{id}}','{{agentNo}}','{{agentKey}}','{{agentName}}','{{phone}}'
                                    ,'{{status}}','{{email}}','{{pro}}','{{city}}')">
                                <i class="fa    fa-pencil-square-o"></i>
                            </button>

                            <button class="btn btn-icon waves-effect waves-light btn-danger"  onclick="deleteAgent('{{id}}')">
                                <i class="fa fa-remove"></i>
                            </button>

                        </script>
                    </table>

                </div>
            </div>
        </div>
    </div>
</div>

<!-- FOOTER -->
<footer class="footer text-right">
    Copyright © 2016 - 2017 济南云上电子科技有限公司. All Rights Reserved.
</footer>
<!-- End FOOTER -->

<!-- 新增窗口 -->
<script id="push-table-template-insert" type="text/x-handlebars-template">
    <div id="pushModel_update">
        <div class="row">
            <div class="col-md-12">
                <form role="form" method="get" name="productform_update" id="productform_update" >
                    <div class="row">
                        <div class="col-sm-12">


                            <div class="form-group col-sm-6">
                                <label>密钥：</label>
                                <input type="text" id="a_agentKey" class="form-control"  placeholder="密钥"/>
                            </div>


                            <div class="form-group col-sm-6">
                                <label>客户名称：</label>
                                <input type="text" id="a_agentName" class="form-control"  placeholder="客户名称"/>
                            </div>


                            <div class="form-group col-sm-6">
                                <label>邮箱：</label>
                                <input type="text" id="a_email" class="form-control"  placeholder="邮箱"/>
                            </div>

                            <div class="form-group col-sm-6">
                                <label>联系电话：</label>
                                <input type="text" id="a_phone" class="form-control"  placeholder="联系电话"/>
                            </div>

                            <div class="form-group col-sm-6">
                                <label>启用状态:</label>
                                <select class="form-control select2" style="width:250px;" id="a_status">
                                    <option value="">请选择启用状态</option>
                                    <option value="1">启用</option>
                                    <option value="0">禁用</option>
                                </select>
                            </div>

                            <div class="form-group col-sm-6">
                                <label>省份:</label>
                                <select class="form-control select2" style="width:250px;" id="a_pro">
                                    <option value="">请选择省份</option>
                                </select>
                            </div>

                            <div class="form-group col-sm-6">
                                <label>地市:</label>
                                <select class="form-control select2" style="width:250px;" id="a_city">
                                    <option value="">请选择地市</option>
                                </select>
                            </div>

                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</script>




<!-- 修改
<script id="push-table-template-update" type="text/x-handlebars-template">
    <div id="pushModel">
        <div class="row">
            <div class="col-md-12">
                <form role="form" method="post" name="agent" id="agent" >
                    <div class="row">
                        <div class="col-md-12">
                            <div class="form-group col-sm-6">
                                <label>客户编码：</label>
                                <input type="text" id="u_agentNo" class="form-control" value="{{agentNo}}"  placeholder="代理商编码"/>
                            </div>

                            <div class="form-group col-sm-6">
                                <label>密钥：</label>
                                <input type="text" id="u_agentKey" class="form-control" value="{{agentKey}}"  placeholder="密钥"/>
                            </div>

                            <div class="form-group col-sm-6">
                                <label>代理商名称：</label>
                                <input type="text" id="u_agentName" class="form-control" value="{{agentName}}"  placeholder="代理商名称"/>
                            </div>

                            <div class="form-group col-sm-6">
                                <label>邮箱：</label>
                                <input type="text" id="u_email" class="form-control" value="{{email}}"  placeholder="邮箱"/>
                            </div>

                            <div class="form-group col-sm-6">
                                <label>启用状态:</label>
                                <select class="form-control select2" style="width:250px;" id="u_status">
                                    <option value="">请选择启用状态</option>
                                    <option value="1">启用</option>
                                    <option value="0">禁用</option>
                                </select>
                            </div>

                            <div class="form-group col-sm-6">
                                <label>省份:</label>
                                <select class="form-control select2" style="width:250px;" id="u_pro">
                                    <option value="">请选择省份</option>
                                </select>
                            </div>

                            <div class="form-group col-sm-6">
                                <label>地市:</label>
                                <select class="form-control select2" style="width:250px;" id="u_city">
                                    <option value="">请选择地市</option>
                                </select>
                            </div>

                            <div class="form-group col-sm-6">
                                <label>联系电话：</label>
                                <input type="text" id="u_phone" class="form-control" value="{{phone}}"  placeholder="联系电话"/>
                            </div>

                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</script> -->

<script th:src="@{customer/js/admin/agent/agent_list.js}"></script>
</body>
</html>